ActiveAdmin.register Event do

  show do
    attributes_table :name, :show_time
    render "duel_list"
  end

  controller do
    def permitted_params
      params.permit(event: [:name, :show_time])
    end

    def create
      @event = Event.new(permitted_params[:event])
      @event.save
      @event.gen_duels
      redirect_to admin_event_path(@event)
    end
  end
end
